import cx_Oracle
import utils.utils as utils
import logging
from genericDB import genericDB


class oracledb(genericDB):
    def __init__(self):
        self.config = utils.readConfig()
        self.logger = logging.getLogger('automatic.oracledb')

    def getConnection(self, host, sid, user='', password=''):
        try:
            connection = cx_Oracle.connect(user + '/' + password + '@' + host + '/' + sid)
        except Exception as e:
            self.logger.critical('Problem with connection to  host: %s, %s' % (host, e))
        return connection

    
    

    
    
            

